<extend name="Index:base" />
        <block name="b_content">
            <div id="content-header">
                <h1>友链管理</h1>
            </div>
            <div id="breadcrumb">
                <a href="#" title="Go to Home" class="tip-bottom"><i class="icon-home"></i> Home</a>
                <a href="#" class="current">友链管理</a>
            </div>
            <notempty name="notice">
            <p style="width:100%;text-align:center;color:#f00;font-weight: bold;">{$notice}</p>
            </notempty>
            <div class="container-fluid">
                <div class="row-fluid">
                    <div class="span12">
                        <div class="widget-box">
                            <div class="widget-title">
                                <span class="icon">
                                    <input type="checkbox" id="title-checkbox" name="title-checkbox" />
                                </span>
                                <h5>友情链接列表</h5>
                            </div>
                            <div class="widget-content nopadding">
                                <table class="table table-bordered table-striped with-check">
                                    <thead>
                                        <tr>
                                            <th><i class="icon-resize-vertical"></i></th>
                                            <th>标题</th>
                                            <th>URL<span style="color: #f00;">【填写带“http://”开头的完整url】</span></th>
                                            <th>状态</th>
                                            <th>操作</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                    <volist name="links" id="link" >
                                        <tr>
                                            <td><input type="checkbox" /></td>
                                            <td>{$link.title}</td>
                                            <td>{$link.url}</td>
                                            <if condition="$link['status'] eq 0">
                                            <td>隐藏 <a href="javascript:toggle({$link.id},1);" class="btn">显示</a></td>
                                            <else />
                                            <td>显示 <a href="javascript:toggle({$link.id},1);" class="btn">隐藏</a></td>
                                            </if>
                                            <td>
                                                <a href="javascript:toggle({$link.id},2);" class="btn">删除</a>
                                            </td>
                                        </tr>
                                    </volist>
                                    <tr>
                                    <form action="{:U('/Prom/Index/fl@'. getDomain())}" method="post">
                                        <td>+</td>
                                        <td><input type="text" name="newtitle" value="{$newtitle}" placeholder="在这里输入友链标题" maxlength="32"/></td>
                                        <td><input type="text" name="newurl" value="{$newurl}" placeholder="在这里输入友链URL" maxlength="255" style="width: 300px;"/></td>
                                        <td colspan="2">
                                            <input type="submit" class="btn" value="添加" />
                                        </td>
                                    </form>
                                    </tr>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </block>
<block name="b_footer_script">
    <div style="display: none;">
        <div id="sendbox" class="popbox-bg">
            <div class="title">发送消息</div>
            <div class="body">
                <p>内容</p>
                <textarea id="msg" placeholder="在这里输入消息内容……"></textarea>
                <p><a id='send' class="btn">发送</a><a id="cancel" class="btn pull-right">关闭</a></p>
            </div>
        </div>
    </div>
    <script>
        function toggle(link,ot){
            var url = "{:U('/Prom/Index/togglelink_ajax@'. getDomain())}";
            $.post(url, {'link':link,'ot':ot}, function(data){
                var vdata = eval(data);
                if(vdata.success==1){
                    window.location.reload();
                }
                else {
                    alert("操作失败！");
                }
            }, 'json');
        }
    </script>
</block>